Stock market prediction using Altruistic Dragonfly Algorithm

Stock market prediction is the process of determining the value of a company’s shares and other financial assets in the future. This paper proposes a new model where Altruistic Dragonfly Algorithm (ADA) is combined with Least Squares Support Vector Machine (LS-SVM) for stock market prediction. ADA is a meta-heuristic algorithm which optimizes the parameters of LS-SVM to avoid local minima and overfitting, resulting in better prediction performance. Experiments have been performed on 12 datasets and the obtained results are compared with other popular meta-heuristic algorithms. The results show that the proposed model provides a better predictive ability and demonstrate the effectiveness of ADA in optimizing the parameters of LS-SVM.


Introduction
Stock market trading involves buying and selling of shares of a company listed on the stock exchange. Investors seek to maximize profits and minimize risks at every turn. Predicting the ever-changing trends of the share market is a difficult task, yet an accurate prediction can lead to huge gains for the investors. With the increase in awareness about the importance of having a diversified portfolio, more and more individuals are looking to invest smartly in the stock market as a part of their personal finance management. As a result, forecasting the stock market has become a major area of study in recent times. Researchers have used data mining and machine learning approaches to predict stock prices. These techniques are preferred over traditional statistical methods as they can uncover hidden patterns in the historical stock data to get an idea about the future price.
Auto Regressive Integrated Moving Average (ARIMA) is a commonly used technique to predict time series data which has a general trend associated with it [1]. However, this is not very suitable for application in stock market data which is full of non-linear and irregular in nature. To counter that many researchers had used Artificial Neural Networks (ANN) in the past [2]. However, overfitting is often a concern for ANNs because of the large number of parameters to tune and limited knowledge about the relevance of the input with respect to the problem at hand. To fix that hybridization with other optimization algorithms have also been a1111111111 a1111111111 a1111111111 a1111111111 a1111111111 tried by many researchers. Another very popular method is the use of Support Vector Machine (SVM), which is a supervised learning technique introduced by Cortes and Vapnik [3] in 1995. It tends to find the globally optimal solution, unlike ANNs which get stuck in local minima [4].
Another advantage of SVMs is that it is computationally faster as its time complexity is quadratic with respect to the training data, whereas logistic regression has cubic time complexity. However, SVMs do not perform very well in the case of high noise and overlapping target classes. SVMs use quadratic programming (QP) with inequality constraints. To simplify the optimization process, Suykens and Vandewalle introduced a modified SVM called Least Squares SVM (LS-SVM) [5], which involves a least squares function with equality constraints to produce a linear system satisfying the Karush-Kuhn-Tucker (KKT) conditions for getting an optimal solution. In this process, choosing optimal values for the regularization and kernel parameters is vital to make the model robust as the parameters have a considerable impact on the classification or regression performance [6]. In this paper, we take a look at how Dragonfly optimization algorithm with altruism is used to select the parameters of SVM which is then used to predict the stock prices.
The COVID-19 pandemic ongoing for the past couple of years has caused a major shock all over the world. The financial markets have also been badly hit because of lockdowns and other measures placed by governments [7,8]. The economic shock has spread to stock markets as well [9]. After a period of bear markets worldwide [10], stock markets in many countries across the world are experiencing a historic boom and this has led to huge demand for accurate stock market prediction models. This is because people and corporate can then make huge profits by anticipating a rise or fall in stock prices. The proposed work responds to this demand and seeks to develop a reliable model for predicting future stock prices of companies.
The highlighting points of this paper are listed below: • Application of the concept of altruism to improve the exploitation ability of Dragonfly Algorithm (DA).
• Application of Altruistic Dragonfly Algorithm (ADA) to find out the optimal parameters for LS-SVM in the proposed model.
• Experimentation on twelve stock price datasets to predict the future prices.
• Comparison of the proposed model with several meta-heuristics against datasets of 12 companies.
The rest of the paper is organized as follows: Section 2 provides an in-depth literature review. SVM and DA algorithms are presented in Section 3. Section 4 presents the proposed algorithm. Sections 5 and 6 will provide the results, discussions, and conclusions.

Literature survey
SVM and ANN are perhaps the most widely used methods for prediction of stock prices [11]. In recent years, ANNs have been extensively used for solving optimization problems. They are generally hybridized with other optimization algorithms like PSO (Particle Swarm Optimizer), GA (Genetic Algorithm), WOA (Whale Optimization Algorithm), etc. They have the advantage of being able to learn complex patterns in the input data as well as effectively increasing the searching capability of the algorithm through the use of the hybridized optimization algorithms. ANN with PSO and Cuckoo search has been used to solve performance problems [12]. ANN with GA has been used for bankruptcy prediction with very good results [13]. GA has been hybridized with ANN to solve the lipase production problem for penicillium [14]. ANN with Spot Welding Optimization to determine aluminium alloy measurement [15]. Apart from these types of hybridizations, Lyapunov based ANNs have also been used extensively. Lyapunov based NN method is used for safe learning of dynamic systems [16]. Adaptive Lyapunov-based neural network was used for sensorless control of permanent magnet synchronous machines [17]. SVM had been previously used to predict stock prices [18] and ANN as well [19]. SVM was later combined with Empirical Mode Decomposition for improved stock market prediction [20]. Apart from SVM, other notable forecasting methods used include Variable Method Decomposition (VMD) combined with Long Short-Term Memory (LSTM) [21], and wavelet kernel support vector [22]. Meta-heuristics became popular in the finance domain and are nowadays being increasingly used for stock market forecasting. Meta-heuristics can be categorized as nature inspired or non-nature inspired. Amongst them, the former category is more popular due to various advantages: easy implementation, modification and enhancement, no complex mathematical derivation, and its ability to not get stuck in a local optima. A very old and timetested algorithm in this category is Genetic Algorithm (GA) [23]. Further on, nature inspired algorithms are broadly classified into these types: evolutionary, swarm-based, physics-based and human-based algorithms. We now give examples for each of these four types as follows: • Evolutionary algorithms: The mechanism for this type of algorithm is motivated by biological reproduction, crossover, mutation, natural selection and other evolutionary processes. Some popular methods in this category include GA and Genetic Programming [24].
• Swarm-based algorithms: These algorithms are based on the behavior of social animals such as nest-building. In swarms, individuals interact with each other and try to improve their quality by utilizing the knowledge gained by the entire swarm. Famous examples are Particle Swarm Optimization (PSO) [25] and Mayfly Algorithm (MA) [26].
• Physics-based algorithms: These type of algorithms are based on physical phenomenon or physical-chemical interaction. They may be inspired by physics, chemistry, music, etc. An old and popular algorithm in this class is Simulated Annealing (SA) [27] based on the annealing of metals. Other examples are Gravitational Search Algorithm (GSA) [28] and Harmony Search (HS) Algorithm [29].
The four types defined above are pictorially shown in Fig 1. Some notable meta-heuristics used for stock market prediction include PSO [31,32], Artificial Bee Colony [33], Butterfly optimization [34] and GA [35]. Grey Wolf Optimization was combined with Elman Neural Network (ENN) to predict stock prices [36]. A self-adaptable step size optimization algorithm was combined with Fruit Fly Optimization in [37] and used for stock market analysis. The algorithm reduced the step size of fruit flying migration with each iteration, thereby increasing the convergence precision. In [38], PSO was used for the selection of parameters of SVM, which would otherwise be time-intensive and require trial-and-error. However, the high computation time of PSO in determining the parameter values was a significant drawback of this model. The parameters of Convolutional Neural Network (CNN) was improved using GA to forecast stock prices [39]. Here, GA was employed in the search for CNN's optimal architecture, including kernel size of the convolutional layers, the number of kernels, and the pooling window size, which allows to make use of neural networks' ability to model complex nonlinear functions while automatically solving the optimization problem. However, it is still difficult to determine a suitable model that can successfully reflect the characteristics of the problem and efficiently learn the data patterns, due to the numerous controlling parameters.
An Online Sequential Extreme Learning Machine (OSELM) model was optimized using Firefly Algorithm (FA) for financial time series forecasting [40]. Hybrid meta-heuristic algorithms are also becoming quite popular nowadays. In this type of method, an algorithm is combined with another of the same or different type. One of the algorithms is generally used for local search, i.e., for enhancing the exploitation power of the model. They usually perform better than the original algorithmic components. Hybrid meta-heuristics used for stock market prediction include PSO combined with Centre of Mass (COM) technique [41], and LS-SVM combined with traditional methods like PSO, Artificial Bee Colony (ABC) algorithm among others [42].
The works described here do not study and predict fluctuating stock data obtained during the COVID-19 outbreak, whereas our proposed work specifically addresses this gap. Moreover, LS-SVM is a much simpler method when compared to other models such as deep learning based models. Hence, its implementation is easier and the model proposed here will enable new researchers to quickly learn and work more in this domain.

Least square support vector machine
The conventional SVM is a supervised machine learning model which is constructed with QP [43], where a convex cost function is minimized using inequality constraints. LS-SVM was proposed by Suykens and Vandewalle in [5] as a simpler form of the conventional SVM. Here, the classification or regression problem is solved using a set of linear equations with equality constraints.
Consider X as the input n × m data matrix and y as the output n × 1 output vector. Given the fx i ; y i g n i¼1 training dataset, where x i 2 R m , y i 2 R, the objective of the LS-SVM is to construct the function f(x) = y, which represents the relation between the input x i and output y i . The function is as follows: where w is the weight vector in the dimension of feature space, ϕ(x) is a non-linear mapping from the input space to a higher dimensional feature space and b 2 R is the bias term. LS-SVM computes Eq 1 from a similar minimization problem found in the SVM method [3]. LS-SVM uses equality constraints based on a least square cost function. The minimization problem and the equality constraints of LS-SVM are defined as follows: Constraint : where e is the n × 1 error vector and λ is the regularization parameter which penalizes the error. From Eq 2, a Langrangian is formed, which is given as follows: Here, α is a Langrangian multiplier. Differentiating with respect to w, b, e, α, we get the conditions for optimality as: Eliminating w and e, we get a system of linear equations as follows: . α and b are the least square solutions to Eq 6. The LS-SVM regressor output is obtained as: Several types of kernel functions can be used. They are as follows: • Linear kernel: Each type of kernel function has its own advantages. The linear kernel is faster and is usually used to express the linear component of the mapping relation, while the polynomial kernel has effective generalization and approximation abilities. The sigmoid kernel function is similar to a two-layer perceptron model, and is usually preferred for neural networks. In this work, we have used the RBF kernel as it has a wider convergence domain and an excellent learning ability in non-linear data without any prior knowledge.

Dragonfly algorithm
Dragonflies are a species of flying insects belonging to the order Odonata. They feed on small insects like mosquitoes and butterflies, and avoid predators like birds and spiders. They tend to exhibit two very interesting swarming behavioral aspects-static or feeding swarms, and dynamic or migratory swarms. In case of the former [44], they are usually seen forming groups of small sizes and flying over an area to look for possible food sources. For the latter case, dynamic swarms migrate away to a better food location [45]. DA [46] is inspired by these two types of behaviors which resemble the exploitation and exploration stages of a meta-heuristic based optimization algorithm, respectively. The mathematical description of the swarming behavior is controlled through five main parameters [47] which are described below, considering N as the total number of neighboring dragonflies: • Cohesion: This is a parameter that controls the tendency of the dragonflies to move towards the center of mass (COM) of that specific neighborhood. It is calculated by the following equation: Here X j is the position of the j th neighboring dragonfly and X is the location of the current dragonfly.
• Alignment: This parameter gives an idea of the velocity of the current dragonfly with respect to the other neighboring dragonflies. It is mathematically expressed through the following equation: Here V j stands for the velocity of the j th neighboring dragonfly.
• Separation: As the name suggests, this parameter gives a mathematical idea of the separation between the dragonflies. This is reflected by the tendency of the swarm to avoid static collisions by taking each other's separation into account. It is expressed through the following equation: Here, X j stands for the location of the j th neighbor and X stands for the location of the current dragonfly.
• Distraction: This parameter controls how far away the dragonflies should fly to avoid the enemy. This is calculated as follows: Here X − is the enemy position and X is the position of the current dragonfly. This EnemyPos is a special variable that is calculated as the worst solution(Position of the dragonflies) found so far.
• Attraction: This parameter signifies how close to the food the dragonflies should come based on the current food location. It is expressed as follows: Here X + is the position of the food source and X is the position of the current dragonfly. This FoodPos is another special variable that is calculated as the best solution(Position of the dragonflies) found so far.
Another parameter called step vector (ΔX j ) is introduced to calculate the next position of the dragonflies. This parameter is calculated with the help of the five previously mentioned parameters and some random constants. The step vector is calculated with the help of this equation: Here the step vector of the t th iteration is used for calculation of the step vector of the t + 1 th iteration. The five random weight coefficients s, a, c, e, f are multiplied with their respective parameters before adding them to the step vector. Now for the calculation of the new position of the dragonflies, this step vector is added to the previous position.
One thing to note here is that, the neighboring region is defined as a p-dimensional (p is the number of dimensions in the optimization problem) space where the distance between two dragonflies in any dimension is not more than a radius value r. This r increases proportionally with the number of iterations passed, implying the neighboring region becomes bigger. Due to this behavior, the isolated dragonflies of initial smaller neighborhoods tend to explore more. As number of iteration increases, the increase in neighborhood size merges the previously smaller neighborhoods, and creates a bigger swarm of dragonflies. Then that bigger swarm tends to exploit the best solution up to that point. In smaller swarms (first stage of the whole process), the dragonflies have smaller alignment factor and higher cohesion factor values which help them to explore more. The reverse happens in case of exploitation (the second stage of the whole process). The transition from one phase to the other is done by changing the r value accordingly.
The convergence of the algorithm is guaranteed because when the exploration phase turns into exploitation, a dragonfly tends to see more dragonflies in its region and collectively moves away from the enemy, towards the food. (To support this idea, the worst solution is chosen as the enemy location and the best solution is chosen as the food). This behavior causes convergence towards a better solution and divergence from the non-promising solutions.
To increase the randomness of the dragonfly positions and to bring variety in search locations, the idea of Levy flight (a type of random walk) is introduced. When there is no other dragonfly in the neighborhood of a dragonfly, we use this idea to randomly place a dragonfly somewhere around its position. This Levy is calculated using the following equations: Here Γ(x) = (x − 1)!. Then we can update the position, using this following equation: Here d is the dimension of the problem, r 1 and r 2 are two random numbers in the range [0, 1], and β is a constant taken as 1.5.
We also discuss some pros and cons of DA. The dragonflies start as small groups in their own regions which can be initialized to be far apart from one another, so they can do a lot of exploration which leads to finding varied solutions. In case of no neighbours, the dragonflies are spawned using Levy which adds required randomness to the search process, which further improves the exploration ability. The idea of moving away from the enemy and towards the food source makes sure that the dragonflies are searching for viable solutions. This idea paired with some modifications like altruism can lead to very efficient search of the space, which adds an edge to this algorithm. On the other hand, the dragonflies that once reach the boundaries have a tendency to stay at the boundaries, thereby reducing the effective number of dragonflies running the optimization process which can sometimes lead to poor results. In Dragonfly algorithm, there is a lot of neighbour calculation and updation steps, so adding a computationally heavy local search here would further increase the execution time of the algorithm.

Altruism
Altruism is a behavior that benefits others in spite of a cost to oneself. Its is motivated by selflessness and aims to increase the welfare of the community. A good example would be altruism among friends and family members. This behavior is observed in nature as well. In biological terms [48], the cost or benefit of altruism is determined on the basis of reproductive fitness, i.e, the expected number of children or offspring. So, the individual performing altruism reduces its chances of having a child but enhances the possibility of beneficiaries to have more children. In the proposed model, the concept of altruism has been incorporated in DA as described in subsection 4.2.
Altruism has some advantages which are worth mentioning. Firstly, it is a simple method that acts as a local search for the optimizer and it decreases the possibility of getting stuck in a local optimum. Moreover, it does not increase the computational cost too much as altruism itself takes very less time to execute. Based on social behavior, it is easy to conceptualize and implement. However, there is one main drawback of this method. There is no guarantee that altruism will improve the exploitation ability of the optimizer. This is because the beneficiary might not be that important. Since LS-SVM itself takes time to produce results, an efficient local search with low execution time is very important. A major point for including altruism in this study is that it has hitherto never been used in this domain, to the authors' best knowledge. Keeping these facts in mind, we chose to incorporate altruism to the Dragonfly algorithm.

Preprocessing
Five technical indicators are calculated from the raw stock datasets: • Relative Strength-Index (RS-Idx): It is a metric that measures the velocity and magnitude of price movements. The overbought and oversold conditions of an asset are found out using the ratio of recent gains to recent losses. It is calculated as follows: Relative Strength ðRSÞ ¼ Upward price change Downward price change ð18Þ • M-Flow Index (MF-Idx): The volume of money in and out of a security is calculated using this indicator. Unlike RS-Idx which takes the price into account, M-Flow Index considers volume. Its value is derived as follows: • Exponential M-Average (EM-Avg): This metric gives the exponential moving average of a field over a given period of time. It is influenced significantly by most recent data points. EM-Avg formula is as follows: where TC = Today's Closing price, Y = Yesterday's EM-Avg and k = 2/(N+1). Here N is the number of days in EM-Avg.
• M-Average Convergence Divergence (M-ACD): M-ACD is a momentum indicator which denotes the relationship between the long-term and short-term moving averages of a security's price. The formulae for calculating M-ACD and its signal as follows.
M À ACD ¼ EM À Avg long � 0:075 À EM À Avg short � 0:15 ð25Þ where EM-Avg long and EM-Avg short are the long-term and short-term EM-Avg of closing prices respectively.
• Stochastic Oscillator (SO): A stochastic oscillator is a momentum indicator comparing a particular closing price of a security to a range of its prices over a given duration of time. Its formula is as follows: where the most recent closing price is represented by CP, and the lowest price and highest price traded during the look-back period are denoted by LP and HP respectively. %K is the present value of the SO.  (12) if number of neighbors is zero then update the position with Eq (17) else update the position and step vector using Eqs (13) and (14) end if check for out-of-bound values and bring them in range end for end for bestFitness = foodFitness bestLoc = foodPos return bestFitness and bestLoc

Algorithm 2 Altruism in ADA
Choose the worst performing dragonfly as the altruist Find all neighbors of the altruist dragonfly Randomly choose one of its neighbors as the beneficiary rel ¼ 1 À

Distance between altruist and beneficiary Distance between altruist and its farthest neighbor
Move the altruist away from the food source and towards enemy; opposite for beneficiary Ensure that all values are within prescribed bounds Calculate the benefit for the beneficiary and the loss (cost) for the altruist Check if Hamilton's rule (Eq 28) is satisfied If it is not satisfied, then abort the process and revert positions of altruist and beneficiary back to their original values In this work, ADA has been proposed to find the most optimal combination of parameters of LS-SVM for stock price prediction. Two parameters are to be optimized: γ, which is the regularization parameter of LS-SVM, and σ, which is the kernel parameter. The position of a dragonfly represents the values γ and σ. The values of γ and σ are optimized using the equations described in subsection 3.2. At first, we have randomly initialized the positions of the dragonflies and then updated them using the best and worst solutions. The mean square error (MSE) between the actual stock prices and the predicted stock prices is used as the fitness function to judge the quality of the solutions. In the initial stage of the algorithm, the dragonflies explore various regions and find viable solutions, and in the later stages, they all start to group together and move towards the best solution found till then.
Altruism has been added while changing the position of dragonflies during exploration and exploitation. The dragonfly which performs altruism is known as the altruist and the dragonfly which receives the benefits is called the beneficiary. With respect to Eqs 11 and 12, the altruist moves away from the food source and towards the enemy. The opposite happens for the beneficiary, i.e., it moves towards the food source and away from the enemy. The positions of the altruist and the beneficiary are changed by a random number but they are always ensured to be between the lower and upper bounds of the problem. Altruism is carried out if Hamilton's rule [49] is satisfied, according to Eq 28: In the above equation, ben is the cost benefit or the reduction in fitness of the beneficiary, cost is the increase in fitness value of the altruist and rel is the relatedness or the relationship factor between the altruist and the beneficiary, i.e., how much related they are. In case this equation is not satisfied during altruism, or if the benefit of the recipient is less than zero, then altruism is not performed and the agent vectors revert back to their original values. Here the exploitation behavior comes into play. Finally after completing the maximum number of iterations, the dragonfly with the best fitness value gives the best values of γ and σ.
DA has been used recently in various fields of research like feature selection [50,51]. Being a swarm-inspired algorithm, it also has the benefits of the well-known PSO. This algorithm has hitherto not been used for prediction of stock market prices. Moreover, the existence of an insect like dragonfly makes it ideal to incorporate the concept of altruism. The resultant performance is shown in the following sections.

Time complexity analysis
The algorithm runs for maxIt times and for each run, it does the following things: The time complexity of the algorithm is found to be O((n 2 + n * T) * maxIt). Here, n is the population size of the ADA, and maxIt is the total number of iterations. T is the complexity of the objective function requiring one execution of LSSVM, which is typically quadratic in the size of the training dataset.

Experiments
This section deals with the experiments performed. For each company, stock prices from January 2017 to October 2021 are considered, with the first 900 days taken as training set and the next 290 days taken as the testing set. The proposed model is implemented using Python3 [52]. The experiments are conducted on a PC with 3.30 GHz Intel(R) Pentium(R) CPU G4400 and 8 GB Memory.

Parameter tuning
The three main parameters of DA have been given in Table 1. The PopSize i.e., population size is tested for [10,20,30,50] and finally it is set as 20 as it gives the best results. Another attribute β has been set following the original paper on DA. Apart from these, the others parameters like s, c, a, f, e are calculated based on the current number of iterations. These parameters help the algorithm to switch from exploration to exploitation and ensures that the search space of the dragonflies are searched thoroughly.

Results on stock market datasets
For experimental purposes, we have used seven well-known algorithms of Whale Optimization Algorithm (WOA) [53], Salp Swarm Algorithm (SSA) [54], PSO, GSA, GA, Sine Cosine Algorithm (SCA) [55] and Dragonfly Algorithm, apart from the proposed method ADA. They are chosen because all the seven methods are quite popular and have been previously used in the finance domain as well as for other purposes such as feature selection. Each of the eight algorithms is combined with LS-SVM and tested on the the publicly available datasets of 12 companies. The values in Table 2 denote the MSE of the respective algorithm on a dataset. The last column represents the MSE for the proposed model.
Our aim would be to minimize the MSE. Analyzing Table 2, we can see that the proposed method gives the best results for 8 out of 12 datasets; the only exceptions are American Express, ExxonMobil, Honeywell and Tesla. Moreover, there is a tie between SSO and the proposed method in case of Bank of New York. In case of American Express, ExxonMobil and Tesla, the difference between the MSE's of ADA and the respective best algorithm is even lesser than 1%. So the proposed work is almost as good as the best method in case of these 3 datasets; the only significant difference is in case of Honeywell where the MSE of ADA deviates by 3.25%.
Next, we compare the result obtained by ADA with respect to naive Dragonfly algorithm. The proposed model based on ADA gives better results than the original Dragonfly algorithm for all the 12 datasets considered, and that too by a significant margin. The difference in their MSE's is particularly stark for HP, differing by almost 0.08, i.e., by 28%. So we can extrapolate that altruism adds value to original algorithm and improves the overall efficiency of the algorithm.
The original Dragonfly algorithm is the best amongst all the methods except ADA. Thus, it is a good choice for stock market prediction in itself. ADA adds even more value to it. The average rank for the proposed method is the least amongst the eight algorithms so it is assigned the first rank. The proposed model displays a very high level of prediction accuracy since MSE is comparatively low across most of the datasets. Even for datasets like American Express, ExxonMobil and Tesla, where it fails to produce the best results, its results are not significantly worse than those of the best performing algorithm. Thus, ADA combined with LS-SVM can be considered as a state-of-the-art algorithm in this domain. We can infer that the model proposed in this work can be reliably used for predicting the future stock prices of companies. Fig 3 shows the forecast on the data of 12 companies by all the methods taken for comparison purposes. The period shown in the graphs are approximately from September 2020 till September 2021, equal to 290 days. This particular period was chosen as it reflects the changing stock prices during the COVID-19 induced economic recession and later on, a boom. For  Fig 3, the other optimization methods as well as ADA are combined with LS-SVM. We can see that the proposed model gives the most accurate forecasts and shows a high level of precision and forecasting accuracy. ADA is able to accurately predict and follow the trend in the stock prices of companies, even during the COVID period. The results are vindicated by Table 2 as well. Therefore, the proposed method is very reliable for forecasting purposes. In Table 3, the MSE values for ADA with Linear Kernel LS-SVM on different datasets are given. We can see that our proposed model with RBF Kernel LS-SVM produces significantly better results than the one using Linear Kernel.

Results on benchmark functions
Two categories of test functions [56] have been used to benchmark the performance of the proposed ADA with respect to the other meta-heuristic algorithms, and the results are given in Table 4. The first category includes unimodal functions (F1-F5) that have a single optimum solution, so these are used to test the exploitation ability and convergence of the algorithm. The second category includes multi-modal functions (F8-F11) that have more than one local optimum and one global optimum. Thus, the algorithm needs to be able to globally search the space and avoid being trapped in local optima in order to find the global optimum.

Statistical significance test
To assess the statistical significance of the results obtained in Table 2, Wilcoxon rank-sum test is used. It is a non-parametric statistical test where pairwise comparison is done [57]. The null hypothesis is that two sets of results have the same distribution. However, if they are statistically different, then the generated probability value or the p-value will be less than the significance level of 0.05. Thereafter, the null hypothesis will be rejected. Looking at the results of Tables 5 and 6, we can infer that all the results are statistically significant as all the p-values are less than 0.05 in each of these tables.

Data and code availability
All of the 12 datasets used in this paper are available for free over the internet and can be consumed with the following API: https://finance.yahoo.com/quotes/API,Documentation/view/ v1/. Moreover, the whole datasets and the working code are uploaded at the GitHub repository: https://github.com/SayanAcharya2002/StockMarketPrediction.

Conclusion and future work
In this paper, we have proposed a machine learning model using LS-SVM with its parameters optimized using the meta-heuristic ADA and applied it to predict future stock prices. Optimal values of the regularization parameter γ and kernel parameter σ have been found out using the modified version of DA. The proposed model has been applied on stock price datasets of 12 companies namely Adobe, American Express, Apple, AT&T, Bank of New York, Coca-Cola, ExxonMobil, FMC, HP, Honeywell, Oracle and Tesla. The results obtained from the proposed model are compared with those obtained by using seven other meta-heuristic optimization algorithms. Analysis of the results show that the proposed model performs well and has the ability to deal with the irregularities and fluctuations associated with stock price data. For future work, different initialization strategies can be used with ADA to improve population diversity. Depending on the nature of the work, ADA can be used with regression models other than LS-SVM. Local search techniques may be added to further improve exploitation ability. We can apply the proposed model on other types of time series data like gasoline price, unemployment rate in a state, amount of sales, etc. and check if is able to produce reliable forecasting results.